import { defineComponent } from 'vue';
import notFoundImg from '@/assets/images/home/net_err.png';

const ErrorPage = defineComponent({
  name: 'errorPage',
  props: {
    message: {
      type: String,
      default: '页面异常请检查后重新加载'
    }
  },
  setup(props) {
    const reload = () => {
      location.reload();
    };
    return () => (
      <div class="w-full bg-white h-screen">
        {/* <img src={notFoundImg} class="w-72 h-104 m-auto pt-32" /> */}
        <div class=" text-r1.8 relative top-1/2 -translate-y-1/2 left-1/2 inline-block transform -translate-x-1/2 text-center " style="color:#5D646E">
          {'页面错误，请重新加载'}
          <div class="mt-24 w-48 text-center m-auto h-10 leading-10 rounded-3xl text-white cursor-pointer  text-r1.6" onClick={reload} style="background:#E55A48">
          重新加载
        </div>
        </div>
 
      </div>
    );
  }
});

export function renderErrorPage(message: string) {
  return () => <ErrorPage message={message}></ErrorPage>;
}

export default ErrorPage;
